PATH  Mac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Icon Services and Utilities
>
Obtaining and Using Icons With Icon Services

   

GetIconRefFromFolder

Provides an IconRef for a folder with no custom icon.

pascal OSErr GetIconRefFromFolder (
                     SInt16 vRefNum,
                     SInt32 parentFolderID,
                     SInt32 folderID,
                     SInt8 attributes,
                     SInt8accessPrivileges
                     IconRef*iconRef);

vRefNum
A value of type SInt16 specifying the volume where the folder is located.

parentFolderID
A value of type SInt32 specifying the ID of the desired folder's parent folder.

folderID
A value of type SInt32 specifying the ID of the desired folder.

attributes
A value of type SInt8 specifying the attributes of the desired folder. You can obtain this data from the CInfoPBRec.dirInfo.ioFlAttrib field of the folder's catalog information record.

accessPrivileges
A value of type SInt8 specifying the access privileges of the specified folder. You can obtain this data from the CInfoPBRec.dirInfo.ioACUser field of the folder's catalog information record.

iconRef
A pointer to a value of type IconRef . On return, this value contains a reference to the desired icon data.

function result
A result code. See Icon Services Result Codes for a description of possible return values.
DISCUSSION
If you don't have the catalog information for a folder, use the function GetIconRefFromFile. For more information on the PBGetCatInfo function, see Inside Macintosh: Files.

Calling the GetIconRefFromFolder function increments the reference count of the IconRef .

Note

Remember to call the function ReleaseIconRef when you're done with an IconRef .


© 1999 Apple Computer, Inc. – (Last Updated 03 Dec 99)